package cn.codergege.demo.domain

import groovy.transform.Canonical

import javax.validation.constraints.NotNull
import javax.validation.constraints.Past
import javax.validation.constraints.Size

/**
 * Created by codergege on 17-3-2.
 */
@Canonical
class Employee {
    Integer id

    @NotNull(message = "姓名不能为空")
    @Size(min = 1, max=16, message = "长度不对") // 1-16 个字符
    String name

    @NotNull
    Integer gender

    @Past                   // 必须是一个过去的日期
    Date birthday

    String email

    @NotNull
    Department department
}
